#!/usr/bin/env python
# encoding: utf-8
'''
@author: aliax
@license: (C) Copyright 2018-2020.
@contact: 1048327635@qq.com
@file: Ali_proxy.py
@time: 2020/7/9 0009 19:34
@desc:
'''

import sys
import click

sys.path.append('../')

from Config.thread import get_proxy_thread
from Config.thread import check_proxy_thread
from Api.api import runFlask
from Config.config import HEADER
print(__file__)


CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])

@click.group(context_settings=CONTEXT_SETTINGS)
@click.version_option(version='2.0.0')
def cli():
    """AliProxy cli工具"""


@cli.command(name="run")
def schedule():
    """ 启动爬取程序 """
    click.echo(HEADER)
    get_proxy_thread()

@cli.command(name="che")
def schedule():
    """ 启动验证程序 """
    click.echo(HEADER)
    check_proxy_thread()

@cli.command(name="api")
def schedule():
    """ 启动接口程序 """
    click.echo(HEADER)
    runFlask()


if __name__ == '__main__':
    cli()




